YAddress address(std::string("127.0.0.1"), 8000);
	SelectPoll pool;
	YTCPServer server;
	server.bind(&address);
	server.listen();

	auto errorCallBack = [](YSocket* socket) {
		auto errorID = socket->getLastError();
		std::cout << strerror(errorID) << std::endl;
		socket->close();
	};

	auto onReadCallBack = [](YSocket* socket) {
		YTCPClient* client = (YTCPClient*)socket;
		std::cout << "Host:" << client->remote_address()->getHost() << ":" << client->remote_address()->getPort() << std::endl;
		char buff[2024] = { 0x00 };
		auto c = client->receive(buff, 2024);
		if (c == 0)
		{
			client->close();
			return;
		}
		const char* str = "hello  world!";
		client->send(str, strlen(str));
	};

	server.onConnect([&errorCallBack, &onReadCallBack, &pool](YTCPServer* server, YTCPClient* client) 
	{	
		client->onError(errorCallBack);	
		client->setIOPoll(&pool);
	});
	
	server.onWrite([](YSocket* socket) {});
	server.setIOPoll(&pool);
	while (true)
	{
		pool.wait(1);
	}
